package com.sky.mapper;

import com.sky.vo.OrderOverViewVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ReportMapper {

    // 查询营业额数据
    List<Double> getTurnoverStatistics(List<LocalDate> dateList);

    // 查询用户数据
    List<Integer> getUserStatistics(List<LocalDate> dateList);

    // 获取新增用户数
    List<Integer> getNewUserStatistics(List<LocalDate> dateList);

    // 查询订单数据
    List<Integer> getOrderCountList(List<LocalDate> dateList);

    // 查询有效订单数
    List<Integer> getValidOrderCountList(List<LocalDate> dateList);

    // 获取总订单数
    Integer getTotalOrderCount(List<LocalDate> dateList);

    // 获取top10菜品名称
    List<String> getTop10NameList(LocalDate begin, LocalDate end);

    // 获取top10菜品销售量
    List<Integer> getTop10NumberList(LocalDate begin, LocalDate end);

    @Select("select count(id) from setmeal where status = 1")
    Integer getSetmealSoldCount();

    @Select("select count(id) from setmeal where status = 0")
    Integer getSetmealDiscontinuedCount();

    @Select("select count(id) from dish where status = 1")
    Integer getDishSoldCount();

    @Select("select count(id) from dish where status = 0")
    Integer getDishDiscontinuedCount();

    // 获取订单总览数据
    OrderOverViewVO getOrderOverView();
}
